package com.wb.mas.data.source.http.service;

import com.wb.mas.entity.ApproveResponse;
import com.wb.mas.entity.AuthBackResponse;
import com.wb.mas.entity.BackStatusResponse;
import com.wb.mas.entity.BankResponse;
import com.wb.mas.entity.BannerResponse;
import com.wb.mas.entity.CalculateRateResponse;
import com.wb.mas.entity.DeferInfoResponse;
import com.wb.mas.entity.DicInfoResponse;
import com.wb.mas.entity.FaceCompareResponse;
import com.wb.mas.entity.HelpResponse;
import com.wb.mas.entity.IdentityInfoResponse;
import com.wb.mas.entity.LoginResponse;
import com.wb.mas.entity.LoginTypeResponse;
import com.wb.mas.entity.OrderDetailResponse;
import com.wb.mas.entity.OrderListResponse;
import com.wb.mas.entity.OrderPageResponse;
import com.wb.mas.entity.OrderResponse;
import com.wb.mas.entity.PayCodeResponse;
import com.wb.mas.entity.ProDetailResponse;
import com.wb.mas.entity.RemindInfoResponse;
import com.wb.mas.entity.RootApiBean;
import com.wb.mas.entity.SubmitedAuthResponse;
import com.wb.mas.entity.UploadImageResponse;
import com.wb.mas.entity.VersionResponse;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * Created by goldze on 2017/6/15.
 */

public interface ApiService {

    /**
     * 4.	facebook 登录的
     *
     * @param channel
     * @param loginBody
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/auth/jwt/modal/{channel}/accountKitLogin")
    Observable<LoginResponse> login(@Path("channel") String channel, @Body RequestBody loginBody);

    /**
     * 5、首页轮播图
     *
     * @param channel
     * @param bannerBody
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loan/common/modal/{channel}/getNoticeByChannel")
    Observable<BannerResponse> getBanner(@Path("channel") String channel, @Body RequestBody bannerBody);

    /**
     * 6、获取首页产品的接口
     *
     * @param channel
     * @param bannerBody
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loan/common/modal/{channel}/prodRangeNew")
    Observable<ProDetailResponse> getProdDeailList(@Path("channel") String channel, @Body RequestBody bannerBody);

    /**
     * 7. 计算产品费率的
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanProdDetail/modal/{channel}/calculate")
    Observable<CalculateRateResponse> calculateRate(@Body RequestBody body);

    /**
     * 8.	检查提单资格（提单时先判断）
     * URL（先判断提单资格 再判断是否认证 最后提单）
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/checkOrderQualifications")
    Observable<RootApiBean> checkOrderQualifications(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 9.	获取认证状态的
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/user/authentication/modal/app-api/get/status")
    Observable<ApproveResponse> getApproveStatus(@Body RequestBody body);

    /**
     * 10.	提单接口
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/createOrder")
    Observable<RootApiBean> createOrder(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 11.	上传通讯录信息
     *
     * @param channel
     * @param file
     * @return
     */
    @Multipart
    @POST("/asyik2/app/loan/address/book/modal/{channel}/pullUserData")
    Observable<RootApiBean> uploadPhone(@Path("channel") String channel, @PartMap Map<String, RequestBody> files, @Part MultipartBody.Part file);

    /**
     * 12.	上传经纬度（提单成功之后）
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanLonglatitude/modal/{channel}/saveLonglatitude")
    Observable<RootApiBean> saveLngLat(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 13.	上传图片
     *
     * @param map
     * @param file
     * @return
     */
    @Multipart
    @POST("/asyik2/app/user/authentication/modal/app-api/upload/image")
    Observable<UploadImageResponse> uploadImage(@QueryMap Map<String, Object> map, @Part MultipartBody.Part file);

    /**
     * 14. 身份认证界面2张图片对比
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/user/authentication/modal/app-api/face/compare")
    Observable<FaceCompareResponse> faceCompare(@Body RequestBody body);

    /**
     * 15.	保存或修改用户身份认证信息的
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanIdentity/modal/app-api/save/or/update")
    Observable<RootApiBean> updateOrSaveUser(@Body RequestBody body);


    /**
     * 16.	数据字典接口
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/dictInfo/modal/{channel}/queryDictInfoList")
    Observable<DicInfoResponse> getDicInfo(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 17.	工作信息、借款需求、个人信息认证 保存修改的信息
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanCustomerInfo/modal/app-api/save/or/update")
    Observable<RootApiBean> saveOrUpdateCustomerInfo(@Body RequestBody body);

    /**
     * 18.	联系人认证信息的保存和修改
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanContactsInfo/modal/app-api/save/or/update")
    Observable<RootApiBean> saveOrUpdateContactsInfo(@Body RequestBody body);

    /**
     * 19.	获取用户信息的接口
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanIdentity/modal/{channel}/getIdentityInfo")
    Observable<IdentityInfoResponse> getIdentityInfo(@Path("channel") String channel, @Body RequestBody body);


    /**
     * 20.	银行卡认证的保存提交接口
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanBankList/modal/app-api/save/or/update")
    Observable<RootApiBean> saveOrUpdateBankList(@Body RequestBody body);

    /**
     * 21.	图片补充信息的接口
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/user/authentication/modal/app-api/update/additional/information")
    Observable<RootApiBean> imageInformation(@Body RequestBody body);

    /**
     * 22.	根据状态获取订单
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/getOrderInfoList")
    Observable<OrderResponse> getOrderInfoList(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 23.	分页获取订单信息的
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/getOrderInfoPage")
    Observable<OrderPageResponse> getOrderInfoPage(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 24.	银行卡认证的信息的
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanBankList/modal/app-api/get/auth/bank/detail")
    Observable<BankResponse> getBankDetail(@Body RequestBody body);


    /**
     * 25.	获取还款码的接口
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/savePayCode")
    Observable<PayCodeResponse> getPayCode(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 26.	是否可以展期的接口
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loan/common/modal/{channel}/rolloverApp")
    Observable<RootApiBean> rolloverApp(@Path("channel") String channel, @Body RequestBody body);


    /**
     * 27.	获取展期信息的接口
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/extensionTotalAmountOfMoney")
    Observable<DeferInfoResponse> getDeferInfo(@Path("channel") String channel, @Body RequestBody body);


    /**
     * 28.	展期还款码的接口
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/saveExtendedPayCode")
    Observable<PayCodeResponse> getDeferPayCode(@Path("channel") String channel, @Body RequestBody body);

    /**
     * 29.	获取用户资料退回状态
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/loanOrderApply/modal/app-api/get/ma_back/status")
    Observable<BackStatusResponse> getBackStatus(@Body RequestBody body);

    /**
     * 31.	获取帮助中心数据
     *
     * @param channel
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})//需要添加头
    @POST("/asyik2/app/helpCenter/modal/{channel}/getHelpCenterByChannel")
    Observable<HelpResponse> getHelpDatas(@Path("channel") String channel, @Body RequestBody body);


    /**
     * 32.用户名 密码登录接口，测试使用
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/auth/jwt/login")
    Observable<LoginResponse> loginByUserNameAndPasssword(@Body RequestBody body);


    /**
     * 33.资料回退时获取认证信息的
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/app/user/authentication/modal/app-api/get/detail")
    Observable<SubmitedAuthResponse> getSubmitedAuthInfo(@Body RequestBody body);


    /**
     * 34.订单
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/getOrderPageList")
    Observable<OrderListResponse> getOrderPageList(@Path("channel") String channel, @Body RequestBody body);


    /**
     * 34.订单详情
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/app/loanOrderApply/modal/{channel}/getOrderDetail")
    Observable<OrderDetailResponse> getOrderDetail(@Path("channel") String channel, @Body RequestBody body);


    /**
     * 35.获取短信 验证码
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/app/loan/common/modal/getVerificationCode")
    Observable<RootApiBean> getSmsCode(@Body RequestBody body);


    /**
     * 36.短信登录
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/auth/jwt/modal/{channel}/verificationCodeLogin")
    Observable<LoginResponse> loginByPhoneCode(@Path("channel") String channel, @Body RequestBody body);


    /**
     * 37.34.判断登陆方式接口
     *
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/app/loan/common/modal/{channel}/getLoginType")
    Observable<LoginTypeResponse> getLoginType(@Path("channel") String channel, @Body RequestBody body);


    /**
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/app/loanBankList/modal/app-api/get/auth/bank/detail")
    Observable<AuthBackResponse> getSubmitedBankInfo(@Body RequestBody body);

    /**
     * @param body
     * @return
     */
    @Headers({"Content-Type: application/json", "Accept: application/json"})
    @POST("/asyik2/app/loanOrderApply/modal/getRemindInfo")
    Observable<RemindInfoResponse> getRemindInfo(@Body RequestBody body);

}
